﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DashBoard.aspx.cs" Inherits="AiRiZu.user.dashboard.DashBoard" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>
	爱日租—全球最时尚、最具先锋概念的房屋日租、短租服务网站！
</title>
<meta content="爱日租,日租,短租,租房,家庭公寓,自助公寓,家庭旅馆,旅游" name="keywords"/>
<meta content="爱日租是国内首家专注房屋短期租赁的信息发布和在线交易的网站，为房主和租户搭建起最值得信赖的沟通和交易平台" name="description"/>

<link rel="stylesheet" href="css/css.css" />
<link rel="stylesheet" href="css/pixie.css" />
<link rel="stylesheet" href="css/common.css" />
<link rel="Stylesheet" href="css/imgareaselect-default.css" />
<link rel="stylesheet" href="css/dashboard.css" />
<link rel="Stylesheet" href="../FileUploader/fileuploader.css" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="layout" content="main"/>
<style type="text/css" media="screen"></style> 
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
<script type="text/javascript" src="../FileUploader/fileuploader.js"></script>
<script type="text/javascript" src="js/jquery.imgareaselect.min.js"></script>

<script type="text/javascript">

    function showUpload() {
        var e = document.getElementById('uploadSpan')
        if (e.style.display == 'none') {
            e.style.display = ''
        } else {
            e.style.display = 'none'
        }
    }

    function toggleDiv() {
        var d = document.getElementById('upload_person_image');
        if (d.style.display == 'none') {
            d.style.display = '';
        } else {
            d.style.display = 'none';

            clearAll();
        }
    }

    function wait_for_upload() {
        //document.getElementById('upload_image_submit_button').disabled = true; 
        document.getElementById('upload_feedback').innerHTML = "<img src='/images/spinner.gif' />";
        document.getElementById('user_pic').style.opacity = '.4';
        document.getElementById('user_pic').style.filter = 'alpha(opacity=40)';
    }

    function markUserSystemMessageRead(orderId) {
        $.ajax({
            type: "POST",
            url: "/ajax/markUserSystemMessageRead",
            data: 'orderId=' + orderId,
            success: function(result) {
            }
        });
    }

    function clearAll() {
        //清楚imgareaselect and image
        $('#imgAreaSelect-body').html("");
        $('#editImage_1').html("");
        $('ul.qq-upload-list').html("");
    }
</script>

<script type="text/javascript">
    var imgArea = null;
    var imageUrl = '';

    //是否需要剪切
    var imageCut = true;
    function cutImage() {
        if (imageCut && imgArea != null) {
            var sel = imgArea.getSelection();
            //alert(sel.x1 + ':' + sel.y1 + ";" + sel.x2 + ":" + sel.y2)
            $.post('handler/UpdateImg.ashx', { x1: sel.x1, y1: sel.y1, x2: sel.x2, y2: sel.y2, url: imageUrl },
		    	function() {
		    	    //alert('ddd')
		    	    window.location.reload(true);
		    	})
        } else {
            $.post('handler/ReImageName.ashx', { url: imageUrl },
		    	function() {
		    	    //alert('ddd')
		    	    window.location.reload(true);
		    	})
        }

    }
</script>
<script type="text/javascript">

    function clearAll() {
        //清楚imgareaselect and image
        $('#imgAreaSelect-body').html("");
        $('#editImage_1').html("");
        $('ul.qq-upload-list').html("");
    }


</script>
</head>
<body>
<form id="Form1" action="DashBoard.aspx" runat="server">
    <div class="header">
	    <a class="logo" title="爱日租" href="../default.aspx"></a>
	    <div class="top_bar">
		    <ul class="nav">
			
		        <li>
		            <span class="SayHi"><%=Session["aliance"] != null? "嗨! " + Session["aliance"].ToString() : ""%></span>
		        </li>

				<li>
				    <a href="DashBoard.aspx">用户中心</a>
				</li>
				    <li>
					    <strong>
						    <a href="/message/inbox?offset=0" class="message">
							    <span id="unReadMessages"></span>
						    </a>
					    </strong>
					</li>
					
					<li class="rounded">
					    <asp:HyperLink runat="server" ></asp:HyperLink>
						<a href="javascript:void(0)" onclick="AddFavorite(window.location,document.title)">收藏</a>
							<%--收藏--%>
						<%--<span class="star" title="收藏" id="userFavorites"></span></a>--%>
					</li>
				<script type="text/javascript" language="javascript">
                    function AddFavorite(sURL, sTitle)
                    {
                        try
                        {
                            window.external.addFavorite(sURL, sTitle);
                        }
                        catch (e)
                        {
                            try
                            {
                                window.sidebar.addPanel(sTitle, sURL, "");
                            }
                            catch (e)
                            {
                                alert("加入收藏失败，请使用Ctrl+D进行添加");
                            }
                        }
                    }
                    
                </script>

				<li>
				        <asp:LinkButton id="logoutButton" runat="server" onclick="logoutButton_Click">退出</asp:LinkButton>
				    
				</li>
				
			
				<li style="display:none"><span class="ChoLanguage selected">
				<a href="#">简体中文</a></span></li>
                <li style="display:none"><span class="EngLanguage">
       	        <a href="#">English</a></span></li>
	     
			
			
		</ul>
		<a href="../SendRoom.aspx" class="btn list_your_space">
			<span>发布房间</span>		</a>		</div>
		<p class="customer_hot_line"><span>400-696-6656</span><a href="#">媒体报道</a></p>
	</div>
	
	<div id="command_center">

			

        <ul id="nav">
	        <li id="dashboardmenu"><a href="dashboard.aspx">我爱日租</a></li>
	        <li id="inboxmenu"><a href="Index.aspx">收件箱</a></li>
	        <li id="roomsmenu"><a href="MyRooms.aspx">我的房间</a></li>
	        <li id="tripsmenu"><a href="Trips.aspx">出行计划</a></li>
	        <li id="accountmenu"><a href="Warnset.aspx">账户信息</a></li>
	        <li id="commentsmenu"><a href="Comments.aspx">评价推荐</a></li>
	        <li id="vouchersmenu"><a href="Vouchersinvite.aspx">赢取租币</a></li>
        </ul>

			<div id="dashboard">
				<div id="left">
					<div id="user_box" class="box">
						<div class="top">
							<!-- 上传头像  begin-->
								
							<div class="PopBox" style="top: 10%; display: none;" id="upload_person_image">
							    <div class="PMain" style="height: 500px; width: 600px;">
							        <div class="title"><h3>上传一张新照片</h3><a class="close" onClick="toggleDiv();"></a></div>
						            <p><b>上传自己的照片可以在爱租网上为您赢得更多的信任，您可以上传自己喜欢的新照片</b></p><br />
						        <!-- content -->
                                    <div id="au-photoUploader">
                                        <noscript>
                                            <p>Please enable JavaScript to use file uploader.</p>
                                        </noscript>
                                    </div>
       
								    <div id="editImage_1" style="margin:0 30px;"></div>
									<button onClick="cutImage();">保存</button>
							    </div>
							    <div class="PopBoxBg" style="height: 508px; width: 608px;"></div>
							</div>
							
							<!-- 上传头像  end-->
						</div>
						<div class="middle">
							<div id="user_pic">
								<a href="#none"> 
	                            <img height="200px" src="<%=TeSeimgurl %>" title='<%=Session["aliance"] != null? Session["aliance"].ToString() : ""%>' alt='<%=Session["aliance"] != null? Session["aliance"].ToString() : ""%>' width="200px" />								</a>							
	                        </div>
							<h1><%=Session["aliance"] != null? Session["aliance"].ToString() : ""%><br/>
								<span style="font-size: .55em; font-weight: bold; margin-left: 2px;">
									<a href="Edit.aspx">编辑个人信息</a>
									<a href="#" onClick="toggleDiv();" style="margin-left: 20px;">上传头像</a>
									<script type="text/javascript">
									    var au_photoUploader = new qq.FileUploader({
									        element: document.getElementById('au-photoUploader'),
									        action: 'handler/ImgFileUpload.ashx',
									        sizeLimit: 4096000,
									        onComplete: function(id, fileName, responseJSON) {
									            var json = responseJSON;
									            //清楚提示信息
									            clearAll();
									            imageUrl = json.path;
									            $('#editImage_1').html('<img id="editImage_11" src="'+ json.path + '"/>');


									            //判断是否需要剪切
									            if (json.isCut) {
									                //alert(json.isCut)
									                imgArea = $('#editImage_11').imgAreaSelect({ x1: 0, y1: 0, x2: 200, y2: 200,
									                    instance: true, resizable: false, persistent: true, parent: '#imgAreaSelect-body'
									                });
									            } else {
									                imageCut = false;
									            }
									        }

									    });

									    function toggleDiv() {
									        var d = document.getElementById('upload_person_image');
									        if (d.style.display == 'none') {
									            d.style.display = '';
									        } else {
									            d.style.display = 'none';

									            clearAll();
									        }
									    }
									</script>
								</span>
							</h1>
						</div>
						<!-- middle -->
						<div class="bottom"></div>
					</div>
					
					<!-- /user -->
					<div id="quick_links" class="box">
						<div class="top"></div>
						<div class="middle">
							<h2>常用操作</h2>
							<ul>
								<li><a href="MyRooms.aspx">所有房间</a></li>
		                        <li><a href="Calendar.aspx">日历</a></li>
		                        <li><a href="MyListings.aspx">房间预订</a></li>
		                        <li><a href="Comments.aspx">评价</a></li>
								
							</ul>
						</div>
						<div class="bottom"></div>
					</div>
					
				</div>
				<!-- /left end-->
				<div id="main">
					<div id="alerts" class="box">
						<div class="top"></div>
						<div class="middle">
							<h2 id="systemMsgCount">
								系统消息
							</h2>
							<ul id="ulSystemMessage">
								<script type="text/javascript">

								    $.ajax({
								        type: "POST",
								        url: "handler/SystemMessage.ashx",
								        data: 1,
								        success: function(result) {
								            $("#ulSystemMessage").html(result);
								        }
								    });
                                </script>

							</ul>
						</div>
						<div class="bottom">&nbsp;</div>
					</div>
					<div id="messages" class="box">
						<div class="top">&nbsp;</div>
						<div class="middle" style="margin-bottom: -14px">
							<h2>
								未读消息 (0)
							</h2>
							<ul id="ulUserMessage">
								<script type="text/javascript">
								    $.ajax({
								        type: "POST",
								        url: "handler/UnreadMessage.ashx",
								        data: 1,
								        success: function(result) {
								        $("#ulUserMessage").html(result);
								        }
								    });
                                </script>
							</ul>
							<div id="more_messages" class="box_button">
								<a href="/message/inbox?offset=0">转到收件箱</a>							</div>
							<div class="clear"></div>
						</div>
						<!-- /middle -->
						<div class="bottom">&nbsp;</div>
					</div>
					<!-- /messages -->
				</div>
				<!-- /main -->
				<div class="clear"></div>
			</div>
			<!-- /dashboard -->
		</div>

	<div id="imgAreaSelect-body"></div>

</form>
	<!-- footer -->
	
<div id="footer">
  <p class="TxtEn">&copy; Copyright 2011 <a href="#">airizu.com 爱日租 版权所有</a>&nbsp;&nbsp;京ICP证110553 号
	 <br/>
	 <br/><img src="images/alipay.gif" width="123" height="40">&nbsp;&nbsp;
    <img src="images/tenpay.gif" width="96" height="40">&nbsp;&nbsp;    <img src="images/315.gif" width="89" height="40">    <img src="images/bluelogoair.gif"/></p>
</div>

	
	
</body>
</html>
